/* ========================================================= Liga Tocho CDMX A.C. — Landing Edita CONFIG, EVENTOS y TESTIMONIOS para actualizar el sitio. ========================================================= */ const CONFIG = { // Número de WhatsApp con lada de país, solo dígitos (ej. 5215512345678) whatsapp: "5547853172", telefonoTexto: "WhatsApp: 55-4785-3172", email: "ligatochocdmx@gmail.com", direccion: "Deportivo Hermanos Galeana, Ciudad de México.", horarios: "Fines de semana. Horarios por categoría según el rol de juegos.", comoLlegar: "Accesible en transporte público y con estacionamiento en el deportivo. Usa el botón de Google Maps para trazar tu ruta.", redes: { instagram: "https://www.instagram.com/explore/locations/1001726073203010/liga-tocho-cdmx/", facebook: "https://www.facebook.com/ligatochocdmx", youtube: "https://www.youtube.com/channel/UCmIyKOKVZJheesGdtoTWBLA", tiktok: "https://www.tiktok.com/@ligatochocdmx", }, }; // Fechas clave de la temporada. fecha: "AAAA-MM-DD" o null si está por confirmar. // estado: "open" (verde), "hot" (rojo) o "" (neutro). const EVENTOS = [ { fecha: null, titulo: "Inscripciones abiertas", detalle: "Registro de equipos para todas las categorías.", estado: "open", etiqueta: "Abiertas", }, { fecha: null, titulo: "Junta de capitanes", detalle: "Reglamento, rol de juegos y entrega de documentación.", estado: "", etiqueta: "Por confirmar", }, { fecha: null, titulo: "Jornada inaugural", detalle: "Arranque de temporada · Deportivo Hermanos Galeana.", estado: "hot", etiqueta: "Próximamente", }, { fecha: null, titulo: "Playoffs y finales", detalle: "Eliminatorias y premiación por categoría.", estado: "", etiqueta: "Por confirmar", }, ]; // Testimonios reales de jugadores o coaches. Si queda vacío, el bloque se oculta. // Ejemplo: { texto: "…", nombre: "Nombre Apellido", rol: "Capitán · Varonil" } const TESTIMONIOS = []; /* ---------------------------------------------------------- */ document.documentElement.classList.remove("no-js"); const $ = (sel, ctx = document) => ctx.querySelector(sel); const $$ = (sel, ctx = document) => [...ctx.querySelectorAll(sel)]; const waLink = (msg) => `https://wa.me/${CONFIG.whatsapp}?text=${encodeURIComponent(msg)}`; // Datos de contacto y enlaces $$("[data-config]").forEach((el) => { const value = CONFIG[el.dataset.config]; if (value) el.textContent = value; }); $$("[data-whatsapp]").forEach((el) => { el.href = waLink(el.dataset.whatsapp); }); $$("[data-email]").forEach((el) => { el.href = `mailto:${CONFIG.email}`; }); $$("[data-social]").forEach((el) => { const url = CONFIG.redes[el.dataset.social]; if (url) el.href = url; }); const year = $("#year"); if (year) year.textContent = new Date().getFullYear(); // Header al hacer scroll const header = $("#header"); const onScroll = () => header.classList.toggle("is-scrolled", window.scrollY > 30); onScroll(); window.addEventListener("scroll", onScroll, { passive: true }); // Menú móvil const nav = $("#nav"); const toggle = $("#navToggle"); const setMenu = (open) => { nav.classList.toggle("is-open", open); toggle.setAttribute("aria-expanded", String(open)); toggle.setAttribute("aria-label", open ? "Cerrar menú" : "Abrir menú"); document.body.classList.toggle("nav-open", open); }; toggle.addEventListener("click", () => setMenu(!nav.classList.contains("is-open")), ); $$("a", nav).forEach((a) => a.addEventListener("click", () => setMenu(false))); document.addEventListener("keydown", (e) => { if (e.key === "Escape") setMenu(false); }); // Enlace activo según la sección visible const links = $$(".nav__link"); const sections = links.map((l) => $(l.getAttribute("href"))).filter(Boolean); const navObserver = new IntersectionObserver( (entries) => { entries.forEach((entry) => { if (!entry.isIntersecting) return; links.forEach((l) => l.classList.toggle( "is-active", l.getAttribute("href") === `#${entry.target.id}`, ), ); }); }, { rootMargin: "-45% 0px -50% 0px" }, ); sections.forEach((s) => navObserver.observe(s)); // Calendario const MESES = [ "Ene", "Feb", "Mar", "Abr", "May", "Jun", "Jul", "Ago", "Sep", "Oct", "Nov", "Dic", ]; const eventosEl = $("#eventos"); if (eventosEl) { eventosEl.innerHTML = EVENTOS.map((ev) => { let date = `
${ev.detalle}
${t.texto}